package com.hubu.list;

import java.util.HashMap;

public abstract class AbstractList<T> implements List<T> {
    protected  int size;
    protected Visitor<T> visitor;
    protected  Comparator<T> comparator;
    public AbstractList(Comparator<T> comparator,Visitor<T> visitor){
        this.comparator=comparator;
        this.visitor=visitor;
    }
    @Override
    public boolean isEmpty() {
        return size==0;
    }

    @Override
    public int size() {
        return size;
    }

    @Override
    public Comparator<T> getComparator() {
        return comparator;
    }

    @Override
    public Visitor<T> getVisitor() {
        return visitor;
    }
}
